﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

namespace Sinc.ERP.Application;

/// <summary>
/// 客户信息基础输入参数
/// </summary>
public class CustomerBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }

    /// <summary>
    /// 联系人姓名
    /// </summary>
    public virtual string? Name { get; set; }

    /// <summary>
    /// 联系电话
    /// </summary>
    public virtual string? Code { get; set; }

    /// <summary>
    /// 详细地址
    /// </summary>
    public virtual string? Remark { get; set; }

}

/// <summary>
/// 客户信息分页查询输入参数
/// </summary>
public class PageCustomerInput : BasePageInput
{
    /// <summary>
    /// 联系人姓名
    /// </summary>
    public string? Name { get; set; }

    /// <summary>
    /// 联系电话
    /// </summary>
    public string? Code { get; set; }

    /// <summary>
    /// 详细地址
    /// </summary>
    public string? Remark { get; set; }

    /// <summary>
    /// 选中主键列表
    /// </summary>
    public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 客户信息增加输入参数
/// </summary>
public class AddCustomerInput
{
    /// <summary>
    /// 联系人姓名
    /// </summary>
    [Required(ErrorMessage = "联系人姓名不能为空")]
    [MaxLength(50, ErrorMessage = "联系人姓名字符长度不能超过50")]
    public string Name { get; set; }

    /// <summary>
    /// 联系电话
    /// </summary>
    [MaxLength(50, ErrorMessage = "联系电话字符长度不能超过50")]
    public string? Code { get; set; }

    /// <summary>
    /// 详细地址
    /// </summary>
    [MaxLength(500, ErrorMessage = "详细地址字符长度不能超过500")]
    public string? Remark { get; set; }

    /// <summary>
    /// 联系人姓名
    /// </summary>
    [Required(ErrorMessage = "登录名不能为空")]
    [MaxLength(50, ErrorMessage = "登录名字符长度不能超过50")]
    public string LoginName { get; set; }

    /// <summary>
    /// 联系人姓名
    /// </summary>
    [Required(ErrorMessage = "密码不能为空")]
    public string Password { get; set; }
}

/// <summary>
/// 客户信息删除输入参数
/// </summary>
public class DeleteCustomerInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
}

/// <summary>
/// 客户信息更新输入参数
/// </summary>
public class UpdateCustomerInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long Id { get; set; }

    /// <summary>
    /// 联系人姓名
    /// </summary>    
    [Required(ErrorMessage = "联系人姓名不能为空")]
    [MaxLength(50, ErrorMessage = "联系人姓名字符长度不能超过50")]
    public string Name { get; set; }

    /// <summary>
    /// 联系电话
    /// </summary>    
    [MaxLength(50, ErrorMessage = "联系电话字符长度不能超过50")]
    public string? Code { get; set; }

    /// <summary>
    /// 详细地址
    /// </summary>    
    [MaxLength(500, ErrorMessage = "详细地址字符长度不能超过500")]
    public string? Remark { get; set; }

}

/// <summary>
/// 客户信息主键查询输入参数
/// </summary>
public class QueryByIdCustomerInput : DeleteCustomerInput
{
}

/// <summary>
/// 客户信息数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportCustomerInput : BaseImportInput
{
    /// <summary>
    /// 联系人姓名
    /// </summary>
    [ImporterHeader(Name = "联系人姓名")]
    [ExporterHeader("联系人姓名", Format = "", Width = 25, IsBold = true)]
    public string? Name { get; set; }

    /// <summary>
    /// 联系电话
    /// </summary>
    [ImporterHeader(Name = "联系电话")]
    [ExporterHeader("联系电话", Format = "", Width = 25, IsBold = true)]
    public string? Telphone { get; set; }

    /// <summary>
    /// 详细地址
    /// </summary>
    [ImporterHeader(Name = "详细地址")]
    [ExporterHeader("详细地址", Format = "", Width = 25, IsBold = true)]
    public string? Address { get; set; }

}
